extends TextureButton

var move_with_mouse = false
onready var Game = get_tree().current_scene.get_node(".")

func _on_Shovel_pressed():
	move_with_mouse = true
	Game.use_shovel = true
	$se.play()
	pass
	
func _process(delta):
	if move_with_mouse:
		$sprite.global_position = get_global_mouse_position()
	pass

func _input(event):
	if event is InputEventMouseButton:
		if event.is_pressed() and event.button_index == BUTTON_RIGHT:
			move_with_mouse = false
			$sprite.position = Vector2(41,25)
			Game.use_shovel = false
	pass
